import { baseURL } from './api/config'
// const baseURL = process.env.NODE_ENV === 'production' ? '/html' : '/'

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  app: {
    baseURL: baseURL,
    head: {
      htmlAttrs: {
        lang: 'zh-CN'
      },
      viewport: 'width=device-width, initial-scale=1, viewport-fit=cover',
      link: [
        {
          rel: 'preconnect',
          href: '//bedimage.jsvue.cn',
          crossorigin: true
        }
      ]
    }
  },
  components: [
    {
      path: '~/components/',
      pathPrefix: false // 自动导入组件名称
    }
  ],
  experimental: {
    externalVue: true,
    payloadExtraction: false
  },
  modules: [
    '@pinia/nuxt',
    '@ant-design-vue/nuxt'
  ],
  antd:{
    // Options
  },
  ssr: false, // h5单页关闭 'dayjs'
  build: {
    transpile: ['@wattjs/peach', '@wattjs/network'],
  },
  typescript: {
    shim: false
  },
  css: [
    'assets/css/index.css'
  ],
  postcss: {
    plugins: {
    }
  },
  runtimeConfig: {
    public: {},
    app: {
      'BASE_URL': 'https://api.jsvue.cn',
      'XSRF_HEADER': 'x-basement-token',
      'BUS_TYPE': 7, // 上传业务枚举
      'APP_ID': 'H5D9B674D',
      'APP_NAME': '代码演示库',
    }
  },
  devServer: {
    host: 'test.jsvue.cn',
    https: true,
    port: 443
  }
})
